<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Embroidermodder: extern/libembroidery/src/formats/format_csd.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  extensions: ["tex2jax.js", "TeX/AMSmath.js"],
  jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="logo_embroidermodder_2_0.png"/></td>
  <td id="projectalign">
   <div id="projectname">Embroidermodder<span id="projectnumber">&#160;2.0.0-alpha4</span>
   </div>
   <div id="projectbrief">A free and open source software for machine embroidery</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('format__csd_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">format_csd.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &quot;<a class="el" href="embroidery__internal_8h_source.html">../embroidery_internal.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a4fcf3ace27e69d89af9b5e3e786c7fbe"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#a4fcf3ace27e69d89af9b5e3e786c7fbe">CsdSubMaskSize</a>&#160;&#160;&#160;479</td></tr>
<tr class="separator:a4fcf3ace27e69d89af9b5e3e786c7fbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af849ef7c88e1b71d667c96137faeee75"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#af849ef7c88e1b71d667c96137faeee75">CsdXorMaskSize</a>&#160;&#160;&#160;501</td></tr>
<tr class="separator:af849ef7c88e1b71d667c96137faeee75"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac51746f5cf90188f494419ffe291ce59"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#ac51746f5cf90188f494419ffe291ce59">BuildDecryptionTable</a> (int seed)</td></tr>
<tr class="separator:ac51746f5cf90188f494419ffe291ce59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50f9ec4268b8a349c4519d0a91ae9c21"><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#a50f9ec4268b8a349c4519d0a91ae9c21">DecodeCsdByte</a> (long fileOffset, unsigned char val, int type)</td></tr>
<tr class="separator:a50f9ec4268b8a349c4519d0a91ae9c21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13d793c9fa7f0366e371e2ba5bc795ce"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#a13d793c9fa7f0366e371e2ba5bc795ce">readCsd</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, FILE *file)</td></tr>
<tr class="separator:a13d793c9fa7f0366e371e2ba5bc795ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac48ab7a06130111eabb754be9de5089b"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#ac48ab7a06130111eabb754be9de5089b">writeCsd</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, FILE *file)</td></tr>
<tr class="separator:ac48ab7a06130111eabb754be9de5089b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a423c4a85e6e184bafb11931bf48eb6d1"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#a423c4a85e6e184bafb11931bf48eb6d1">_subMask</a> [<a class="el" href="format__csd_8c.html#a4fcf3ace27e69d89af9b5e3e786c7fbe">CsdSubMaskSize</a>]</td></tr>
<tr class="separator:a423c4a85e6e184bafb11931bf48eb6d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff300a9cd128bc0dd787d94b4dc9dca6"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#aff300a9cd128bc0dd787d94b4dc9dca6">_xorMask</a> [<a class="el" href="format__csd_8c.html#af849ef7c88e1b71d667c96137faeee75">CsdXorMaskSize</a>]</td></tr>
<tr class="separator:aff300a9cd128bc0dd787d94b4dc9dca6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8088700999062a5c76345d7a8901c69b"><td class="memItemLeft" align="right" valign="top">const unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="format__csd_8c.html#a8088700999062a5c76345d7a8901c69b">csd_decryptArray</a> []</td></tr>
<tr class="separator:a8088700999062a5c76345d7a8901c69b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >The Singer Embroidery Format (.csd) <a id="a68_csd" name="a68_csd"></a> <a id="a69_Singer" name="a69_Singer"></a></p>
<p >Stitch Only Format. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a4fcf3ace27e69d89af9b5e3e786c7fbe" name="a4fcf3ace27e69d89af9b5e3e786c7fbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fcf3ace27e69d89af9b5e3e786c7fbe">&#9670;&nbsp;</a></span>CsdSubMaskSize</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CsdSubMaskSize&#160;&#160;&#160;479</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af849ef7c88e1b71d667c96137faeee75" name="af849ef7c88e1b71d667c96137faeee75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af849ef7c88e1b71d667c96137faeee75">&#9670;&nbsp;</a></span>CsdXorMaskSize</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CsdXorMaskSize&#160;&#160;&#160;501</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ac51746f5cf90188f494419ffe291ce59" name="ac51746f5cf90188f494419ffe291ce59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac51746f5cf90188f494419ffe291ce59">&#9670;&nbsp;</a></span>BuildDecryptionTable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BuildDecryptionTable </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a50f9ec4268b8a349c4519d0a91ae9c21" name="a50f9ec4268b8a349c4519d0a91ae9c21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50f9ec4268b8a349c4519d0a91ae9c21">&#9670;&nbsp;</a></span>DecodeCsdByte()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char DecodeCsdByte </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>fileOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a13d793c9fa7f0366e371e2ba5bc795ce" name="a13d793c9fa7f0366e371e2ba5bc795ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13d793c9fa7f0366e371e2ba5bc795ce">&#9670;&nbsp;</a></span>readCsd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char readCsd </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>file</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ac48ab7a06130111eabb754be9de5089b" name="ac48ab7a06130111eabb754be9de5089b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac48ab7a06130111eabb754be9de5089b">&#9670;&nbsp;</a></span>writeCsd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char writeCsd </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>file</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a423c4a85e6e184bafb11931bf48eb6d1" name="a423c4a85e6e184bafb11931bf48eb6d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a423c4a85e6e184bafb11931bf48eb6d1">&#9670;&nbsp;</a></span>_subMask</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char _subMask[<a class="el" href="format__csd_8c.html#a4fcf3ace27e69d89af9b5e3e786c7fbe">CsdSubMaskSize</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aff300a9cd128bc0dd787d94b4dc9dca6" name="aff300a9cd128bc0dd787d94b4dc9dca6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff300a9cd128bc0dd787d94b4dc9dca6">&#9670;&nbsp;</a></span>_xorMask</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char _xorMask[<a class="el" href="format__csd_8c.html#af849ef7c88e1b71d667c96137faeee75">CsdXorMaskSize</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a8088700999062a5c76345d7a8901c69b" name="a8088700999062a5c76345d7a8901c69b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8088700999062a5c76345d7a8901c69b">&#9670;&nbsp;</a></span>csd_decryptArray</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const unsigned char csd_decryptArray[]</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
<div class="line">    0x43, 0x6E, 0x72, 0x7A, 0x76, 0x6C, 0x61, 0x6F, 0x7C, 0x29, 0x5D, 0x62, 0x60, 0x6E, 0x61, 0x62,</div>
<div class="line">    0x20, 0x41, 0x66, 0x6A, 0x3A, 0x35, 0x5A, 0x63, 0x7C, 0x37, 0x3A, 0x2A, 0x25, 0x24, 0x2A, 0x33,</div>
<div class="line">    0x00, 0x10, 0x14, 0x03, 0x72, 0x4C, 0x48, 0x42, 0x08, 0x7A, 0x5E, 0x0B, 0x6F, 0x45, 0x47, 0x5F,</div>
<div class="line">    0x40, 0x54, 0x5C, 0x57, 0x55, 0x59, 0x53, 0x3A, 0x32, 0x6F, 0x53, 0x54, 0x50, 0x5C, 0x4A, 0x56,</div>
<div class="line">    0x2F, 0x2F, 0x62, 0x2C, 0x22, 0x65, 0x25, 0x28, 0x38, 0x30, 0x38, 0x22, 0x2B, 0x25, 0x3A, 0x6F,</div>
<div class="line">    0x27, 0x38, 0x3E, 0x3F, 0x74, 0x37, 0x33, 0x77, 0x2E, 0x30, 0x3D, 0x34, 0x2E, 0x32, 0x2B, 0x2C,</div>
<div class="line">    0x0C, 0x18, 0x42, 0x13, 0x16, 0x0A, 0x15, 0x02, 0x0B, 0x1C, 0x1E, 0x0E, 0x08, 0x60, 0x64, 0x0D,</div>
<div class="line">    0x09, 0x51, 0x25, 0x1A, 0x18, 0x16, 0x19, 0x1A, 0x58, 0x10, 0x14, 0x5B, 0x08, 0x15, 0x1B, 0x5F,</div>
<div class="line">    0xD5, 0xD2, 0xAE, 0xA3, 0xC1, 0xF0, 0xF4, 0xE8, 0xF8, 0xEC, 0xA6, 0xAB, 0xCD, 0xF8, 0xFD, 0xFB,</div>
<div class="line">    0xE2, 0xF0, 0xFE, 0xFA, 0xF5, 0xB5, 0xF7, 0xF9, 0xFC, 0xB9, 0xF5, 0xEF, 0xF4, 0xF8, 0xEC, 0xBF,</div>
<div class="line">    0xC3, 0xCE, 0xD7, 0xCD, 0xD0, 0xD7, 0xCF, 0xC2, 0xDB, 0xA4, 0xA0, 0xB0, 0xAF, 0xBE, 0x98, 0xE2,</div>
<div class="line">    0xC2, 0x91, 0xE5, 0xDC, 0xDA, 0xD2, 0x96, 0xC4, 0x98, 0xF8, 0xC9, 0xD2, 0xDD, 0xD3, 0x9E, 0xDE,</div>
<div class="line">    0xAE, 0xA5, 0xE2, 0x8C, 0xB6, 0xAC, 0xA3, 0xA9, 0xBC, 0xA8, 0xA6, 0xEB, 0x8B, 0xBF, 0xA1, 0xAC,</div>
<div class="line">    0xB5, 0xA3, 0xBB, 0xB6, 0xA7, 0xD8, 0xDC, 0x9A, 0xAA, 0xF9, 0x82, 0xFB, 0x9D, 0xB9, 0xAB, 0xB3,</div>
<div class="line">    0x94, 0xC1, 0xA0, 0x8C, 0x8B, 0x8E, 0x95, 0x8F, 0x87, 0x99, 0xE7, 0xE1, 0xA3, 0x83, 0x8B, 0xCF,</div>
<div class="line">    0xA3, 0x85, 0x9D, 0x83, 0xD4, 0xB7, 0x83, 0x84, 0x91, 0x97, 0x9F, 0x88, 0x8F, 0xDD, 0xAD, 0x90</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_dc9e1e299a0b26f222fe6c0a872463f0.html">extern</a></li><li class="navelem"><a class="el" href="dir_6a8aa8af2875e58e82a0145491f7a8e2.html">libembroidery</a></li><li class="navelem"><a class="el" href="dir_50a7dc5dba8160ac8332d90912e622db.html">src</a></li><li class="navelem"><a class="el" href="dir_7d0e9abc6dadcd976ab885d9ba0d632b.html">formats</a></li><li class="navelem"><a class="el" href="format__csd_8c.html">format_csd.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
